package demo016;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

@Component
@PropertySource(value = "classpath:/dept3.properties",encoding = "UTF-8")
public class Pet {
    @Value("${dept3.name}")
    private String name;
    @Value("${dept3.age}")
    private int age;

    public void ser(){
        System.out.println("实验"+name+age);
    }
}
